package components.resultLayer
{
	import UIPhoto.uip_photoEditor;
	import UIPhoto.uip_rect;
	
	import flash.geom.Matrix;
	import flash.geom.Point;
	import flash.geom.Rectangle;

	public class clt_elemRect extends uip_rect {
		public function clt_elemRect(parent:uip_photoEditor, images:Object, styleClass:String='selectRect') {
			super(parent, images, styleClass);
		}

		override protected function minSize(): Number {
			return 0;
		}
		
		override public function setPos(mat: Matrix, contentSize: Point): void {
			var rect: Rectangle;
			
			if (photo != null) { 
/*				_photoRect = new Rectangle(0, 0, contentSize.x, contentSize.y);
				rect = _photoRect.clone();
				
				var irect: Rectangle = image.EnterHere(image.bmSize);
				
				mat.concat(image.matrix);
				mat.scale(irect.width / photo.bitmapData.width, irect.height / photo.bitmapData.height);
				
				rect.topLeft 		= mat.transformPoint(rect.topLeft);
				rect.bottomRight	= mat.transformPoint(rect.bottomRight);
				
				rect.offset(irect.x, irect.y);
				transform.matrix = new Matrix();
				position = rect.topLeft;
				resize(rect.width, rect.height);
				updateCtrlRect();
				visible 	= true;
				setPosNotify();*/
				resize(contentSize.x, contentSize.y);
				updateCtrlRect();
				transform.matrix = mat;
			}
		}		
	}
}